{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>NBA</title>
    <link href="../static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="../static/css/cl-css.css" rel="stylesheet">
    <link href="../static/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="../static/highlight/styles/railscasts.css">
</head>
<body>
<div class="cl-header container-fluid" id="app">
    <div class="header-content container" >
        <nav class="navbar navbar-expand-lg navbar-light">
            <a class="navbar-brand" href="index.html">
                <img src="../static/img/QQQ.jpg" width="144" height="72" alt="">
            </a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse justify-content-end" id="navbarNav">
                <ul class="navbar-nav">
                    {% for cat in categories %}
                            {% if cat.id == category.id %}
                                <li class="nav-item active">
                                    <a class="nav-link" href="/?cat_id={{ cat.id }}">{{ cat.title }}</a>
                                </li>
                            {% else %}
                                <li class="nav-item">
                                    <a class="nav-link" href="/?cat_id={{ cat.id }}">{{ cat.title }}</a>
                                </li>
                            {% endif %}
                        {% endfor %}
                    <li class="nav-item dropdown" v-if="is_login">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" @click="show_menu_click">{{ username }}</a>
                    <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                       <a class="dropdown-item" href="{% url 'polls:writeblog' %}">写文章</a>
                       <a class="dropdown-item" href="{% url 'polls:usercenter' %}">个人信息</a>
                    <div class="dropdown-divider"></div>
                       <a class="dropdown-item" href="{% url 'polls:logout' %}">退出登录</a>
                    </div>
                    </li>
                    <!-- 如果用户未登录，则显示登录按钮 -->
                    <li class="nav-item" v-else>
                        <a class="nav-link" href="{% url 'polls:login' %}">登录</a>
                    </li>
                </ul>
            </div>
        </nav>
    </div>
</div>


<div class="cl-cantainer container">
    <div class="row">
        <div class="col-md-9 cl-left">

            <div class="recommend-index">
                <div class="recommend-top">

                    <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
                        <ol class="carousel-indicators">
                            <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
                            <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
                            <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
                        </ol>
                        <div class="carousel-inner">
                            <div class="carousel-item active">
                                <img class="d-block w-100" src="../static/img/aaa.jpg" alt="First slide" >
                            </div>
                            <div class="carousel-item">
                                <img class="d-block w-100" src="../static/img/sss.jpg" alt="Second slide">
                            </div>
                            <div class="carousel-item">
                                <img class="d-block w-100" src="../static/img/ddd.jpg" alt="Third slide">
                            </div>
                        </div>
                        <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
                            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                            <span class="sr-only">Previous</span>
                        </a>
                        <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
                            <span class="carousel-control-next-icon" aria-hidden="true"></span>
                            <span class="sr-only">Next</span>
                        </a>
                    </div>


                </div>
                <div class="recommend-bottom">
                    <div class="recommend-item">
                        <a href="details.html"><img src="../static/img/fff.jpg" class="img-fluid" alt=""></a>
                    </div>
                    <div class="recommend-item">
                        <a href="details.html"><img src="../static/img/ggg.jpeg" class="img-fluid" alt=""></a>
                    </div>
                </div>

            </div>
            {% for article in articles %}
                <div class="cl-card">
                    <div class="row">
                        <div class="col-lg-3 col-md-4 col-sm-12 cl-card-image"><a href="{% url 'home:details' %}?artid={{article.id}}"><img src="{{ article.avatar.url }}" class="img-fluid" alt=""></a></div>
                        <div class="col-lg-9 col-md-8 col-sm-12 cl-card-main">
                            <h3 class="cl-card-main-title"><a href="{% url 'home:details' %}?artid={{article.id}}">{{article.title}}</a></h3>
                            <p class="cl-card-main-info">{{ article.sumary }}</p>
                            <p class="cl-card-more"><a href="{% url 'home:details' %}?artid={{article.id}}">阅读更多...</a></p>
                        </div>
                    </div>
                </div>

            {% endfor %}





            <nav aria-label="Page navigation example">
                <ul class="pagination justify-content-center">
                    <li class="page-item disabled">
                        <a class="page-link" href="#" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                            <span class="sr-only">Previous</span>
                        </a>
                    </li>
                    <li class="page-item active"><a class="page-link" href="#">1</a></li>
                    <li class="page-item"><a class="page-link" href="#">2</a></li>
                    <li class="page-item"><a class="page-link" href="#">3</a></li>
                    <li class="page-item">
                        <a class="page-link" href="#" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                            <span class="sr-only">Next</span>
                        </a>
                    </li>
                </ul>
            </nav>

        </div>
        <div class="col-md-3 cl-right">
            <div class="right-card">

                <div class="right-card-main">
                    <div class="right-card-title">NBA官方公众号</div>
                    <div class="cl-code">
                        <img src="../static/img/QQQ.jpg" class="img-fluid" alt="">
                        <p>更多福利在公众号领取</p>
                    </div>

                </div>
            </div>

            <div class="right-card">

                <div class="right-card-main">
                    <div class="right-card-title">NBA最新动态</div>
                    <div class="right-recommended"><a href="#"><img src="../static/img/aaa.jpg" class="img-fluid" alt=""></a></div>
                    <ul class="right-recommended-list">
                        {% for foo in comms %}
                            <li><a href="details.html"><i class="fa fa-angle-right" aria-hidden="true"></i>{{ foo.article.title }}</a></li>
                        {% endfor %}
                    </ul>
                </div>
            </div>

            <div class="right-card">

                <div class="right-card-main">
                    <div class="right-card-title"><a href="{% url 'home:shangcheng' %}">NBA商城</a></div>
                    <ul class="label">
                        <li><a href="#">球鞋</a></li>
                        <li><a href="#">球衣</a></li>
                        <li><a href="#">球星手环</a></li>
                        <li><a href="#">篮球</a></li>
                        <li><a href="#">外套</a></li>

                    </ul>
                </div>
            </div>

        </div>
    </div>

</div>

<div class="container-fluid cl-footer">
    <div class="container">
        <p class="cl-copyright">本设计由简.工作室荣誉出品</p>
        <p class="cl-copyright">copyright @ 2017~2018 简.工作室（www.jeanstudio.cn）</p>
    </div>
</div>

<script src="../static/jquery/jquery.min.js"></script>
<script src="../static/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/highlight/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="../static/vue/vue-2.5.16.js"></script>
<script src="../static/js/host.js"></script>
<script src="../static/js/common.js"></script>
<script src="../static/js/index.js"></script>
</body>
</html>